import request from '@/utils/request'
import qs from 'qs'

/**
 * 获取列表
 * @param limit
 * @param offset
 */
export function getTable4List(id) {
  return request({
    url: '/system/tableFour/getTable4List',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

/**
 * 编辑或保存
 * @param id
 * @param name
 * @param imgJson
 * @param showState
 */
export function addOrEdit(id,
                          tableOneId, cyrq, jdr, cyr, sjdwptr,
                          table1Json, type, jcxm, jclx, cyyj,
                          qy, fs, cyyq, xdsd, wd, yqbh, sjjzqxh,
                          jzz, clff, bgxx) {
  return request({
    url: '/system/tableFour/addOrEdit',
    method: 'post',
    data: qs.stringify({
      id,
      tableOneId,
      cyrq,
      jdr,
      cyr,
      sjdwptr,
      table1Json,
      type,
      jcxm,
      jclx,
      cyyj,
      qy,
      fs,
      cyyq,
      xdsd,
      wd,
      yqbh,
      sjjzqxh,
      jzz, clff, bgxx
    })
  })
}

/**
 * 删除
 * @param id
 */
export function del(id) {
  return request({
    url: '/system/tableFour/del',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

export function getInfo(id, table1Id) {
  return request({
    url: '/system/tableFour/getInfo',
    method: 'post',
    data: qs.stringify({
      id, table1Id
    })
  })
}

export function getProjectItem(name) {
  return request({
    url: '/system/items/getProjectItem',
    method: 'post',
    data: qs.stringify({
      name
    })
  })
}
